package android.mcsmtms.constant;


public final class GlobalConstants {
	public final static class ActivityConstants {
		public final static int GET_CODE = 0;
		public final static String SELECTED_ROAD = "SELECTED_ROAD";
		public final static String SELECTED_SITUATION = "SELECTED_SITUATION";
		public final static String SELECTED_TRAFFIC_CONDITION = "SELECTED_TRAFFIC_CONDITION";
		public final static String SELECTED_DESCRIPTION = "SELECTED_DESCRIPTION";
	}

	public final static class GPSConstants {
		public static final int INDEX_KM = 0;
		public static final int INDEX_MI = 1;
		public static final int INDEX_M = 2;
		public static final int DEFAULT_SPEED_LIMIT = 80;
		public static final int HOUR_MULTIPLIER = 3600;
		public static final double UNIT_MULTIPLIERS[] = { 0.001,
				0.000621371192, 1 };
	}
	
	public final static class RestUrls {
		//http://mcsmtms-ws.appspot.com/rest/hazardmap/
		//http://mcsmtms-ws.appspot.com/rest/mobileUserReports/
		
		public static final String LOGIN_URL = "http://mcsmtms-ws.appspot.com/rest/users/";
		public static final String LOCAL_LOGIN_URL = "http://localhost:8888/rest/users/";
		public static final String HAZARD_MAP_URL = "http://mcsmtms-ws.appspot.com/rest/hazardmap/";
		public static final String LOCAL_HAZARD_MAP_URL = "http://localhost:8888/rest/hazardmap/";
		public static final String MOBILE_USER_REPORTS_URL = "http://1b.mcsmtms-ws.appspot.com/rest/mobileUserReports/"; 
		public static final String LOCAL_MOBILE_USER_REPORTS_URL = "http://localhost:8888/rest/mobileUserReports/";
		public static final String SEND_MOBILE_USER_REPORT_REST_SERVICE_URL = "http://mcsmtms-ws.appspot.com/rest/mobileUserReports/";
		public static final String LOCAL_SEND_MOBILE_USER_REPORT_REST_SERVICE_URL = "http://localhost:8888/rest/mobileUserReports/";
		public static final String NOTIFICATIONS_URL = "http://mcsmtms-ws.appspot.com/rest/notifications/";
		public static final String APPROVE_REPORT_REST_SERVICE_URL = "http://mcsmtms-ws.appspot.com/rest/notifications/approve/";
		public static final String REJECT_REPORT_REST_SERVICE_URL = "http://mcsmtms-ws.appspot.com/rest/notifications/reject/";
	}
	
//	public static enum Roads {
//		// 1 Bayan-Bayanan Avenue
//		// 2 E. Rodriguez Avenue
//		// 3 E. Santos Avenue
//		// 4 J.P. Rizal Street
//		// 5 J. Molina Street
//
//		// var bayanBayananLatLng = new google.maps.LatLng(14.65073, 121.10763);
//		// var eRodriguezAveLatLng = new google.maps.LatLng(14.644670,
//		// 121.100856);
//		// var eSantosAveLatLng = new google.maps.LatLng(14.64613, 121.10231);
//		// var jpRizalStLatLng = new google.maps.LatLng(14.649714,121.10109);
//		// var jMolinaStLatLng = new google.maps.LatLng(14.64768,121.106884);
//		BAYAN_BAYANAN(1, "Bayan-Bayanan Avenue",
//				"https://sites.google.com/site/mcdrrmo/kml/1_heavy.kml",
//				GPSUtils.getPoint(14.65073, 121.10763)), E_RODRIGUEZ(2,
//				"E. Rodriguez Avenue",
//				"https://sites.google.com/site/mcdrrmo/kml/2_heavy.kml",
//				GPSUtils.getPoint(14.644670, 121.100856)), E_SANTOS(3,
//				"E. Santos Avenue",
//				"https://sites.google.com/site/mcdrrmo/kml/3_heavy.kml",
//				GPSUtils.getPoint(14.64613, 121.10231)), JP_RIZAL(4,
//				"J.P. Rizal Street",
//				"https://sites.google.com/site/mcdrrmo/kml/4_heavy.kml",
//				GPSUtils.getPoint(14.649714, 121.10109)), J_MOLINA(5,
//				"J. Molina Street",
//				"https://sites.google.com/site/mcdrrmo/kml/5_heavy.kml",
//				GPSUtils.getPoint(14.64768, 121.106884));
//
//		private final int code; // code
//		private final String description; // description
//		private final String kml;
//		private final GeoPoint geoPoint;
//
//		Roads(int code, String description, String kml, GeoPoint geoPoint) {
//			this.code = code;
//			this.description = description;
//			this.kml = kml;
//			this.geoPoint = geoPoint;
//		}
//
//		public int getCode() {
//			return code;
//		}
//
//		public String getDescription() {
//			return description;
//		}
//
//		public String getKml() {
//			return kml;
//		}
//
//		public static String getDescriptionByCode(int code) {
//			for (Roads road : values()) {
//				if (road.getCode() == code)
//					return road.getDescription();
//			}
//			return null;
//		}
//
//		public GeoPoint getGeoPoint() {
//			return geoPoint;
//		}
//
//	}
	
	public static enum Views {
		HAZARD_MAP, MONITOR_SPEED, ABOUT 
	}

	public static enum Roads {
		// 1 Bayan-Bayanan Avenue
		// 2 E. Rodriguez Avenue
		// 3 E. Santos Avenue
		// 4 J.P. Rizal Street
		// 5 J. Molina Street
		BAYAN_BAYANAN("BAYAN_AVE", "Bayan-Bayanan Avenue"), E_RODRIGUEZ("EROD_AVE",
				"E. Rodriguez Avenue"), E_SANTOS("ESANTOS_AVE", "E. Santos Avenue"), JP_RIZAL(
				"JPRIZAL_ST", "J.P. Rizal Street"), J_MOLINA("JMOLINA_ST", "J. Molina Street");

		private final String code; // code
		private final String description; // description

		Roads(String code, String description) {
			this.code = code;
			this.description = description;
		}

		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}

		public static String getDescriptionByCode(String code) {
			for (Roads road : values()) {
				if (road.getCode().equals(code))
					return road.getDescription();
			}
			return null;
		}
		
		public static String getCodeByDescription(String description) {
			for (Roads road : values()) {
				if (road.getDescription().equals(description))
					return road.getCode();
			}
			return null;
		}
	}

	public static enum SituationTypes {
		// 1 Accident
		// 2 Blocked/Closed Road
		// 3 Flood
		// 4 Road Works
		// 5 Bad Weather
		ACCIDENT("ACCIDENT", "Accident"), BLOCKED("BLOCKED_ROAD", "Blocked/Closed Road"), FLOOD("FLOOD",
				"Flood"), ROAD_WORKS("ROAD_WORKS", "Road Works"), BAD_WEATHER("BAD_WEATHER",
				"Bad Weather");

		private final String code; // code
		private final String description; // description

		SituationTypes(String code, String description) {
			this.code = code;
			this.description = description;
		}

		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}

		public static String getDescriptionByCode(String code) {
			for (SituationTypes situationType : values()) {
				if (situationType.getCode().equals(code))
					return situationType.getDescription();
			}
			return null;
		}
		
		public static String getCodeByDescription(String description) {
			for (SituationTypes situationType : values()) {
				if (situationType.getDescription().equals(description))
					return situationType.getCode();
			}
			return null;
		}
	}

	public static enum TrafficConditionTypes {
		LIGHT("LIGHT", "Light"), NORMAL("NORMAL", "Normal"), HEAVY("HEAVY", "Heavy");

		private final String code; // code
		private final String description; // description

		TrafficConditionTypes(String code, String description) {
			this.code = code;
			this.description = description;
		}

		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}

		public static String getDescriptionByCode(String code) {
			for (TrafficConditionTypes trafficConditionType : values()) {
				if (trafficConditionType.getCode().equals(code))
					return trafficConditionType.getDescription();
			}
			return null;
		}
		
		public static String getCodeByDescription(String description) {
			for (TrafficConditionTypes road : values()) {
				if (road.getDescription().equals(description))
					return road.getCode();
			}
			return null;
		}
	}
	
	public static enum Direction {
		//A_TO_B
		//B_TO_A
		A_TO_B("A_TO_B", "Point A to point B"), B_TO_A("B_TO_A", "Point B to point A");

		private final String code; // code
		private final String description; // description

		Direction(String code, String description) {
			this.code = code;
			this.description = description;
		}

		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}

		public static String getDescriptionByCode(String code) {
			for (Direction direction : values()) {
				if (direction.getCode().equals(code))
					return direction.getDescription();
			}
			return null;
		}
		
	}
	
	public static enum UserTypes {
		// 1 MMDA
		// 2 Web User
		// 3 Mobile User
		// 4 Anonymous Web User
		MMDA("MMDA", "MMDA"), 
		USER("USER", "User"), 
		SCOUT("SCOUT", "Scout"),
		BAYANAN_SCOUT("BAYANAN_SCOUT", "Bayan-Bayanan Ave. Scout"),
		EROD_SCOUT("EROD_SCOUT", "E. Rodriguez Ave. Scout"),
		ESANTOS_SCOUT("ESANTOS_SCOUT", "E. Santos Ave. Scout"),
		JMOLINA_SCOUT("JMOLINA_SCOUT", "J. Molina St. Scout"),
		JPRIZAL_SCOUT("JPRIZAL_SCOUT", "J.P. Rizal St. Scout"),
		BAYANAN_MMDA("BAYANAN_MMDA", "Bayan-Bayanan Ave. MMDA"),
		EROD_MMDA("EROD_MMDA", "E. Rodriguez Ave. MMDA"),
		ESANTOS_MMDA("ESANTOS_MMDA", "E. Santos Ave. MMDA"),
		JMOLINA_MMDA("JMOLINA_MMDA", "J. Molina St. MMDA"),
		JPRIZAL_MMDA("JPRIZAL_MMDA", "J.P. Rizal St. MMDA");

		private final String code; // code
		private final String description; // description

		UserTypes(String code, String description) {
			this.code = code;
			this.description = description;
		}

		public String getCode() {
			return code;
		}

		public String getDescription() {
			return description;
		}

		public static String getDescriptionByCode(String code) {
			for (UserTypes userType : values()) {
				if (userType.getCode().equals(code))
					return userType.getDescription();
			}
			return null;
		}
	}
	
}
